home *** CD-ROM | disk | FTP | other *** search
/ Adventures with Oslo: Tools & Gadgets / Adventures with Oslo - Tools and Gadgets.ISO / pc / program / ad / quit / 00011.ls < prev    next >
Encoding:
Text File  |  1994-09-23  |  1.2 KB  |  41 lines

  1. on startMovie
  2.   set HC to the number of cast "handCursor"
  3.   cursor([HC, HC + 1])
  4. end
  5.  
  6. on save module
  7.   global gHardDiskPath, gBackPack, gTools
  8.   set prefFile to FileIO(mnew, "read", gHardDiskPath & "OTGPref")
  9.   if not objectp(prefFile) then
  10.     alert("Error reading file " & gHardDiskPath & "OTGPref")
  11.   else
  12.     set temp to prefFile(mReadFile)
  13.     prefFile(mdispose)
  14.     set lineNum to 1
  15.     repeat while (lineNum <= the number of lines in temp) and not (line lineNum of temp starts "## adventure game:")
  16.       set lineNum to lineNum + 1
  17.     end repeat
  18.     if lineNum <= the number of lines in temp then
  19.       put "## adventure game: " into line lineNum of temp
  20.       put module after line lineNum of temp
  21.       put "; " & string(gBackPack) after line lineNum of temp
  22.       put "; " & string(gTools) after line lineNum of temp
  23.     end if
  24.     set prefFile to FileIO(mnew, "write", gHardDiskPath & "OTGPref")
  25.     if not objectp(prefFile) then
  26.       alert("Error writing to file " & gHardDiskPath & "OTGPref")
  27.     else
  28.       prefFile(mWriteString, temp)
  29.       prefFile(mdispose)
  30.     end if
  31.   end if
  32.   go(1, gHardDiskPath & "OSLOMain")
  33. end
  34.  
  35. on stopMovie
  36.   if the machineType = 256 then
  37.     closeXLib("@::fileio.dll")
  38.     closeXLib("@::scikids.dll")
  39.   end if
  40. end
  41.